
package GUI;

import GUI.añadido.AñadirEmpleado;
import GUI.añadido.AñadirServicio;
import GUI.ver.MenuServicios;
import base.Empleado;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Toolkit;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.swing.JFrame;
import negocio.bd.BDTareas;
import negocio.bd.BDTecnicos;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.DateAxis;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.category.BarRenderer;
import org.jfree.chart.renderer.xy.XYItemRenderer;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.time.Day;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
import utiles.ConversorFecha;
/**
 *
 * @author Efren
 */
public class VistaAdministrador extends javax.swing.JFrame {
ChartPanel CP;
ChartPanel CT;
    /**
     * Creates new form VistaAdministrador
     */
    public VistaAdministrador() {
        CP = crearGraficoTareasTecnico();
        CT = crearGraficoTareas();
        initComponents();
        setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/img/ico.png")));
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
        this.relTarMesDia.setText(BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Tarea` WHERE DATE(fechaInicio) = CURDATE()") + " / " + BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Tarea` WHERE fechaInicio > DATE_SUB(CURDATE(),INTERVAL 1 MONTH)"));
        this.relPetMesDia.setText(BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Peticiones` WHERE DATE(fechaPeticion) = CURDATE()") + " / " + BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Peticiones` WHERE fechaPeticion > DATE_SUB(NOW(),INTERVAL 1 MONTH)"));
        this.tarFinHoy.setText(""+BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Tarea` WHERE DATE(fechaFinalizada) = CURDATE()"));
        this.tarFinSem.setText(""+BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Tarea` WHERE fechaInicio > DATE_SUB(CURDATE(),INTERVAL 1 WEEK)"));
        this.tarPendientes.setText(""+BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Tarea` WHERE estado = 'PENDIENTE'"));
        this.medTarPendTec.setText(""+BDTareas.consultar("SELECT AVG(sum) FROM(SELECT COUNT(*) as `sum` FROM `gestionTienda`.`Participan` INNER JOIN `gestionTienda`.`Tarea` ON `Participan`.`idTarea` = `Tarea`.`idTarea` WHERE estado = 'PENDIENTE' GROUP BY idEmpleado) AS `TAREAS`"));
        this.numEqAlmacen.setText(""+BDTareas.consultar("SELECT COUNT(*) FROM `gestionTienda`.`AlmacenEquipos` WHERE fechaRecogida IS NULL"));
        this.numAvPen.setText(""+ BDTareas.consultar("SELECT COUNT(*) FROM `gestionTienda`.`Avisos` WHERE estaNotificado = 0"));
        this.aviHoyMes.setText(""+ BDTareas.consultar("SELECT COUNT(*) FROM `gestionTienda`.`Avisos` WHERE fechaNotificado = CURDATE()")  + " / " + BDTareas.consultar("SELECT COUNT(*) FROM `gestionTienda`.`Avisos` WHERE fechaNotificado > DATE_SUB(CURDATE(), INTERVAL 1 MONTH)"));
    }
    public ChartPanel crearGraficoTareas(){
        /*TimeSeries s1 = new TimeSeries("Tareas Finalizadas", Day.class);
        TimeSeries s2 = new TimeSeries("Peticiones Nuevas", Day.class);*/
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        GregorianCalendar fechaActual = new GregorianCalendar();
        GregorianCalendar fechaFinal = new GregorianCalendar();
        fechaActual.add(GregorianCalendar.DAY_OF_MONTH, -7);
        while (fechaFinal.after(fechaActual)){
            //System.out.println(""+fechaActual.get(Calendar.DAY_OF_MONTH) + "/" + (fechaActual.get(Calendar.MONTH)+1) + "/" +fechaActual.get(Calendar.YEAR));
            fechaActual.add(GregorianCalendar.DAY_OF_MONTH, 1);
            dataset.addValue(BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Tarea` WHERE estado = 'FINALIZADO' AND fechaFinalizada = '"+ ConversorFecha.formatearSoloFecha(fechaActual) +"'"), "Tareas finalizadas",new Day(fechaActual.get(Calendar.DAY_OF_MONTH), (fechaActual.get(Calendar.MONTH)+1) , fechaActual.get(Calendar.YEAR)));
            dataset.addValue(BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Peticiones` WHERE DATE(fechaPeticion) = '"+ ConversorFecha.formatearSoloFecha(fechaActual) +"'"), "Peticiones nuevas", new Day(fechaActual.get(Calendar.DAY_OF_MONTH), (fechaActual.get(Calendar.MONTH)+1) , fechaActual.get(Calendar.YEAR)));
        }
        /*TimeSeriesCollection dataset = new TimeSeriesCollection();
        dataset.addSeries(s1);
        dataset.addSeries(s2);*/
        //JFreeChart chart = ChartFactory.createBarCChart("Tareas / peticiones", "Fecha","Finalizadas - Nuevas", dataset,true, true,false);
        JFreeChart chart = ChartFactory.createBarChart("Tareas finalizadas/ peticiones nuevas","Fecha","Finalizadas - Nuevas",dataset,PlotOrientation.VERTICAL, true,true,false);
        CategoryPlot plot = chart.getCategoryPlot();
        /*XYPlot plot = (XYPlot) chart.getPlot();
        XYItemRenderer r = plot.getRenderer();*/
        plot.getRangeAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits());

        /*DefaultCategoryDataset s1 = new DefaultCategoryDataset();
        GregorianCalendar fechaActual = new GregorianCalendar();
        GregorianCalendar fechaFinal = new GregorianCalendar();
        fechaActual.add(GregorianCalendar.DAY_OF_MONTH, -15);
        while (fechaFinal.after(fechaActual)){
            System.out.println();
            s1.addValue(BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Tarea` WHERE estado = 'FINALIZADO' AND fechaFinalizada = '"+ ConversorFecha.formatearSoloFecha(fechaActual) +"'"), "Tareas Finalizadas",""+fechaActual.get(Calendar.DAY_OF_MONTH) + "/" + (fechaActual.get(Calendar.MONTH)+1) + "/" +fechaActual.get(Calendar.YEAR));
            s1.addValue(BDTareas.consultar("SELECT count(*) FROM `gestionTienda`.`Peticiones` WHERE DATE(fechaPeticion) = '"+ ConversorFecha.formatearSoloFecha(fechaActual) +"'"), "Peticion nueva", ""+fechaActual.get(Calendar.DAY_OF_MONTH) + "/" + (fechaActual.get(Calendar.MONTH)+1) + "/" +fechaActual.get(Calendar.YEAR));
            fechaActual.add(GregorianCalendar.DAY_OF_MONTH, 1);
        }
        JFreeChart chart = ChartFactory.createBarChart("Relación tareas / peticiones", "Fecha", "Finalizadas", s1, PlotOrientation.VERTICAL, true, true, false);*/
        return new ChartPanel(chart);
    }
    public ChartPanel crearGraficoTareasTecnico(){
        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        for (Empleado temp : BDTecnicos.obtenerTodos()){
            dataset.addValue(BDTareas.obtenerNumeroTareasTecnico(temp.getIdEmpleado()), "Tareas", temp.getNombre());
        }
        JFreeChart chart = ChartFactory.createBarChart("Tareas por técnico", "Técnico", "Tareas", dataset,PlotOrientation.VERTICAL,false, true, false);
        chart.setBackgroundPaint(Color.white);
        CategoryPlot plot = (CategoryPlot) chart.getPlot();
        plot.getRangeAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits());
        plot.setBackgroundPaint(Color.lightGray);
        plot.setRangeGridlinePaint(Color.white);
        return new ChartPanel(chart);

    }    
  
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        relTarMesDia = new javax.swing.JLabel();
        relPetMesDia = new javax.swing.JLabel();
        tarFinHoy = new javax.swing.JLabel();
        tarFinSem = new javax.swing.JLabel();
        tarPendientes = new javax.swing.JLabel();
        medTarPendTec = new javax.swing.JLabel();
        numEqAlmacen = new javax.swing.JLabel();
        numAvPen = new javax.swing.JLabel();
        aviHoyMes = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        panelTareas = new javax.swing.JPanel();
        panelTecnicos = new javax.swing.JPanel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        mnuNuevoTecnico = new javax.swing.JMenuItem();
        mnuVerTodos = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        mnuNuevoServicio = new javax.swing.JMenuItem();
        mnuVerServicios = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Gestioneitor 2000 - Menu Administrador");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos Actuales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14))); // NOI18N

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel1.setText("Total tareas nuevas hoy / mes:");

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel2.setText("Total peticiones nuevas hoy / mes:");

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel3.setText("Tareas finalizadas hoy:");

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel4.setText("Tareas finalizadas semana:");

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel5.setText("Número de equipos en almacen:");

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel6.setText("Número de avisos sin notificar:");

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel7.setText("Avisos notificados hoy / mes:");

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel8.setText("Número de tareas pendientes:");

        jLabel9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel9.setText("Media tareas pendientes por técnico:");

        relTarMesDia.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        relTarMesDia.setText("jLabel10");

        relPetMesDia.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        relPetMesDia.setText("jLabel10");

        tarFinHoy.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        tarFinHoy.setText("jLabel11");

        tarFinSem.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        tarFinSem.setText("jLabel10");

        tarPendientes.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        tarPendientes.setText("jLabel10");

        medTarPendTec.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        medTarPendTec.setText("jLabel10");

        numEqAlmacen.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        numEqAlmacen.setText("jLabel10");

        numAvPen.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        numAvPen.setText("jLabel10");

        aviHoyMes.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        aviHoyMes.setText("jLabel10");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(relTarMesDia, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(relPetMesDia, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(tarFinHoy, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(tarFinSem, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(numAvPen, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(aviHoyMes, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(tarPendientes, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(medTarPendTec, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(numEqAlmacen, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(relTarMesDia))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(relPetMesDia))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(tarFinHoy))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(tarFinSem))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(tarPendientes))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(medTarPendTec))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(numEqAlmacen))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(numAvPen))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(aviHoyMes))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Estadisticas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 14))); // NOI18N

        panelTareas.setLayout(new java.awt.BorderLayout());
        panelTareas.add(CT);

        panelTecnicos.setLayout(new java.awt.BorderLayout());
        panelTecnicos.add(CP, BorderLayout.CENTER);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panelTareas, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
                    .addComponent(panelTecnicos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(panelTareas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelTecnicos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jMenu1.setText("Empleados");

        mnuNuevoTecnico.setText("Nuevo..");
        mnuNuevoTecnico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuNuevoTecnicoActionPerformed(evt);
            }
        });
        jMenu1.add(mnuNuevoTecnico);

        mnuVerTodos.setText("Ver todos");
        jMenu1.add(mnuVerTodos);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Servicios");

        mnuNuevoServicio.setText("Nuevo...");
        mnuNuevoServicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuNuevoServicioActionPerformed(evt);
            }
        });
        jMenu2.add(mnuNuevoServicio);

        mnuVerServicios.setText("Ver todos");
        mnuVerServicios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuVerServiciosActionPerformed(evt);
            }
        });
        jMenu2.add(mnuVerServicios);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mnuNuevoTecnicoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuNuevoTecnicoActionPerformed
        //Abrir la ventana para añadir empleados
        AñadirEmpleado a = new AñadirEmpleado();
        a.setLocationRelativeTo(null);
        a.setVisible(true);
    }//GEN-LAST:event_mnuNuevoTecnicoActionPerformed

    private void mnuNuevoServicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuNuevoServicioActionPerformed
        // Abir ventana para añadir servicios.
        AñadirServicio a = new AñadirServicio();
        a.setLocationRelativeTo(null);
        a.setVisible(true);
    }//GEN-LAST:event_mnuNuevoServicioActionPerformed

    private void mnuVerServiciosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuVerServiciosActionPerformed
        // TODO add your handling code here:
        MenuServicios m = new MenuServicios();
         m.setLocationRelativeTo(null);
         m.setVisible(true);
         
    }//GEN-LAST:event_mnuVerServiciosActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(VistaAdministrador.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(VistaAdministrador.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(VistaAdministrador.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(VistaAdministrador.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VistaAdministrador().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel aviHoyMes;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel medTarPendTec;
    private javax.swing.JMenuItem mnuNuevoServicio;
    private javax.swing.JMenuItem mnuNuevoTecnico;
    private javax.swing.JMenuItem mnuVerServicios;
    private javax.swing.JMenuItem mnuVerTodos;
    private javax.swing.JLabel numAvPen;
    private javax.swing.JLabel numEqAlmacen;
    private javax.swing.JPanel panelTareas;
    private javax.swing.JPanel panelTecnicos;
    private javax.swing.JLabel relPetMesDia;
    private javax.swing.JLabel relTarMesDia;
    private javax.swing.JLabel tarFinHoy;
    private javax.swing.JLabel tarFinSem;
    private javax.swing.JLabel tarPendientes;
    // End of variables declaration//GEN-END:variables
}
